#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
using namespace std;
int reverse(int number) {
	int k = number;
	queue<int> Q;
	while (number % 10 == 0) {
		number /= 10;
	}
	while (number) {
		int a = number % 10;
		Q.push(a);
		number /= 10;
	}
	int num = 0;
	while (Q.size()) {
		num += Q.front() * pow(10, Q.size() - 1);
		Q.pop();
	}
	if (k >= 0) return num;
	else return -1 * num;
}
int main()
{
	int n;
	cin >> n;
	cout << reverse(n);
	return 0;
}